import request from "@/utils/request";
const url = "/router/";

export function getMenu(): Promise<IResponse<MenuBack[]>> {
  return request({
    url: url + "list",
    method: "GET",
  });
}
export function add(data: MenuBack): Promise<IResponse<MenuBack>> {
  return request({
    url: url + "add",
    method: "post",
    data
  });
}
export function edit(data: MenuBack): Promise<IResponse<MenuBack>> {
  return request({
    url: url + "edit",
    method: "post",
    data,
  });
}

export function del(id: IDType): Promise<IResponse<void>> {
  return request({
    url: url + "del",
    method: "delete",
    params: {
      id,
    },
  });
}
